$('form').on('submit',(e)=>{
//   console.log($('form').serialize())
  e.preventDefault()
  $.ajax({
      url: '/user/login',
      type: 'post',
      data: $('form').serialize(),
      success: function(data){
          layer.msg(data.msg);
          if (data.code) {
              setTimeout(()=>{
                  location.href = '/main'
              },2000)
          }
      },
      error: function(err){
          console.log(err)
      }
  })
})